<template>
    <div class="container">
        <!--    <div class="flex-container">
                <div class="flex-item">
                    <div class="date-c">
                        <div class="date" @click="selectTime(0)">开始日期：{{startTime?$moment(startTime).
                            format('YYYY-MM-DD HH:mm'):"不限"}}
                        </div>
                        <div class="date" @click="selectTime(1)"
                             style="margin-top: 4px">截止日期： {{endTime?$moment(endTime).format('YYYY-MM-DD HH:mm'):"不限"}}
                        </div>
                        <div>
                            <el-button type="primary" size="small" @click="searchData(0)">确定</el-button>
                            <el-button type="default" size="small" @click="searchData(1)">重置</el-button>
                        </div>
                    </div>
                </div>
            </div>-->

        <el-table v-loading="yewuLoading" :data="yewuList" class="el-mb-15" stripe>
            <el-table-column prop="id" label="ID"/>
            <el-table-column prop="zhicheng" label="名称"/>
            <el-table-column prop="phone" label="电话"/>

            <el-table-column fixed="right" label="操作">
                <template slot-scope="scope">
                    <el-button @click.stop="goList(2,scope.row.id)" type="text"
                               size="small">查看
                    </el-button>

                </template>
            </el-table-column>
        </el-table>
        <!--<el-pagination
            @size-change="eventUpdateRequestLimit" @current-change="controllerRequestListDataset"
            :current-page="yewuQuery.page" :page-size="yewuQuery.list_rows" :total="yewuQuery.total"
            :page-sizes="[10, 50, 100, 200, 300]"
            layout="total, sizes, prev, pager, next, jumper"
        ></el-pagination>-->


        <!--<van-popup v-model="timeSection.show" position="bottom" :close-on-click-overlay="false">
            <div v-show="curTime==0">
                <van-datetime-picker v-model="curTimeValue" @cancel="timeSection.show = false"
                                     @confirm="startTimeSection" type="datetime"/>
            </div>
            <div v-show="curTime==1">
                <van-datetime-picker v-model="curTimeValue" @cancel="timeSection.show = false"
                                     @confirm="endTimeSection" type="datetime"/>
            </div>
        </van-popup>-->
    </div>
</template>

<script>

    import fly from "../../../src/libs/js/request.js"
    import {DatetimePicker, Popup} from 'vant';

    export default {
        name: 'salesmanIndexs',
        components: {
            [DatetimePicker.name]: DatetimePicker, [Popup.name]: Popup,

        },
        data() {
            return {

                yewuList: [],
                yewuFinished: false,
                yewuLoading: false,
                yewuQuery: {
                    page: 0,
                    list_rows: 10,
                },

            }
        },
        mounted() {

            this.onLoadYeWu();
        },
        methods: {


            async onLoadYeWu() {
                if (this.yewuLoading) {
                    return
                }

                let params = this.yewuQuery;
                params.token = this.$store.state.options.user.token;
                params.groupid = parseInt(this.$route.params.index) + 1;
                params.userId = this.$route.params.id;
                params.status = 5;

                let res = await fly.post("/api/home/order/getlist", params);
                if (res.code == 200) {
                    this.yewuList = (res.data)
                    this.yewuQuery.page++;
                }
                this.yewuLoading = false;
            },


        }
    }
</script>

<style lang="scss" scoped>
    .date-c {
        padding: 10px;
        font-size: 14px;
        height: 80px;
        border-bottom: 3px solid #EEEEEE;
        background-color: white;
        display: flex;
        align-items: center;

        .date {
            padding: 8px 20px;
            border: 1px solid #dddfe2;
            width: 200px;
            border-radius: 5px;
            display: inline-block;
            margin-right: 10px;
        }
    }

    .searchBtn {
        display: inline-block;
        padding: 5px 15px;
        font-size: 12px;
        text-align: center;
        color: white;
        background-color: #00CC00;
        margin-top: 5px;
        margin-right: 10px;
    }

    .bac-grey {
        background-color: #A3A3A3 !important;
    }

    .title {
        padding: 10px 10px;
        background-color: #EEEEEE;
    }

    .list {
        padding: 10px;
        font-size: 14px;
        border-bottom: 1px solid #EEEEEE;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .page-top {
        width: 100%;
        height: 3rem;
        position: relative;

        .notice {
            position: absolute;
            top: 0rem;
            width: 100%;
            margin: 0rem;
            padding: 0.7rem 1rem;
            display: flex;
            background: rgba(255, 247, 209, 1);
            z-index: 1;
            box-sizing: border-box;

            dt {
                padding-right: 1rem;

                img {
                    width: 1.4rem;
                }
            }

            dd {
                white-space: nowrap;
                flex: 1;
                margin: 0rem;
                padding: 0rem;
                color: #ff9000;
                font-size: 1.3rem;
            }
        }
    }


</style>
